package com.sogoodsoft.unit.basic;

import java.util.List;
import java.util.Map;

import org.hibernate.Query;
import org.hibernate.Session;
import org.junit.Test;
public class Leftjoin extends DAOTestBase {
	
	@SuppressWarnings({ "unused", "unchecked" })
    @Test
	public void leftjoin() {
		String hql="from User";

		try {
			Session session = sessionFactory.openSession();
			session.beginTransaction();
			Query query = null;

			hql=" from User left join Phonebook as book ";
			query = session.createQuery(hql);
			List<Map<String,String>> pl = query.list();
		
			session.getTransaction().commit();
			session.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
